﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Models;
using BLL;
using Newtonsoft.Json.Linq;

namespace GoShopping.tools
{
    /// <summary>
    /// Car 的摘要说明Car_Goods表
    /// </summary>
    public class Car : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            getAll(context);
        }

        //查询数据
        private void getAll(HttpContext context)
        {
            int UserID = int.Parse(context.Request.QueryString["tyID"]);
            List<Car_Goods> list = Car_Goods_BLL.getAllBLL(UserID);
            JObject obj = new JObject();
            JArray array = JArray.FromObject(list);
            obj.Add("res", array);
            if (list.Count > 0)
            {
                context.Response.Write(obj);
            }
            
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}